/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __BLENDER_BUILDER_H__
#define __BLENDER_BUILDER_H__

#include "GEngine.h"

namespace GNgine
{
	/** Singleton class used to load blender file and simple manipulate it
    */
	class BlenderBuilder
	{
	private:
		SceneObject* _sceneObject;

		bool _inited;
	protected:
		BlenderBuilder();
	public:
		~BlenderBuilder();
		static BlenderBuilder& getSingleton();
		void init(Ogre::String wnd,int width,int height);

		inline void activate()
		{
			GNgEngine.setActiveScene(_sceneObject);
		}

		inline void renderOneFrame()
		{
			if(SceneObject::isActivate(_sceneObject)){
				GNgEngine.renderOneFrame(_sceneObject);
			}
		}

		void update(float deltaT);

		//Input 
		void ResetScreenResolution(int width,int height);//
		void ResetInput();

		void OnKeyDown(Ogre::uint key);
		void OnKeyUp(Ogre::uint key);
		
		void OnMouseLeftDown(int x,int y);
		void OnMouseLeftUp(int x,int y);

		void OnMouseRightDown(int x,int y);
		void OnMouseRightUp(int x,int y);

		void OnMouseMidDown(int x,int y);
		void OnMouseMidUp(int x,int y);

		void OnMouseMove(int x,int y);
	};

}
#define GBlenderBuilder GNgine::BlenderBuilder::getSingleton()
#endif
